package com.dongliu.service;

import com.dongliu.domain.Book;
import com.dongliu.domain.LentRecord;
import com.dongliu.domain.User;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface LentRecordService {

    /**
     * 保存
     * @param lentRecord
     * @return
     */
    public boolean save(LentRecord lentRecord);

    /**
     * 修改
     * @param lentRecord
     * @return
     */
    public boolean update(LentRecord lentRecord);

    /**
     * 按id删除
     * @param lentId
     * @return
     */
    public boolean delete(Integer lentId);

    /**
     * 按username查询
     * @param username
     * @return
     */
    public List<LentRecord> getByUsername(String username);

    /**
     * 按lentId查询
     * @param lentId
     * @return
     */
    public LentRecord getByLentId(Integer lentId);
    /**
     * 查询所有
     * @return
     */
    public List<LentRecord> getAll();

    public int getCount();
    public boolean createRecord(Book book, User user);
    public List<LentRecord> getAllByUsername(String username);
    public List<LentRecord> getNotReturnByUsername(String username);
    public LentRecord returnBook(LentRecord lentRecord);
}
